package test1;

/**
 * @Author admin
 * @Date 2019/3/22 10:25
 */
public class PrinterFactory {
    public static Printer getPrinter(int sr) {
        Printer printer;
        if (sr==1){
            printer=new HPPrinter();
        }else {
            printer=new CanonPrinter();
        }
        return  printer;
    }
}
